<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<link href="images/reset.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<link href="images/system.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<link href="images/table_form.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="js/admin_public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script> 
<title>后台管理</title>
<link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet">
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/phpyun_layer.js?v={yun:}$config.cachecode{/yun}"></script>
</head>
<body class="body_ifm">
<div class="infoboxp"> 
<div class="admin_new_tip">
<a href="javascript:;" class="admin_new_tip_close"></a>
<a href="javascript:;" class="admin_new_tip_open" style="display:none;"></a>
<div class="admin_new_tit"><i class="admin_new_tit_icon"></i>操作提示</div>
<div class="admin_new_tip_list_cont">
<div class="admin_new_tip_list">计划任务是一项使系统在规定时间自动执行某些特定任务的功能。</div>
<div class="admin_new_tip_list">管理员可以通过“计划任务”实现自动刷新职位、简历刷新和生成XML操作。计划任务可以设置计划类型按“天、周、月”方式去执行！</div>
</div>
</div>
<div class="clear"></div>


<div class="tag_box mt10">
	<iframe id="supportiframe"  name="supportiframe" onload="returnmessage('supportiframe');" style="display:none"></iframe>
    <form action="index.php?m=cron&c=save" method="post" target="supportiframe" class="layui-form">
    <input type="hidden" name="pytoken" value="{yun:}$pytoken{/yun}">
    <table width="100%" class="table_form">
     <tr>
              <td colspan="2" bgcolor="#f0f6fb"><div class="admin_bold">添加计划任务</div></td>
            </tr>
       <tr>
            <th width="140">任务名称：</th>
            <td><input class="input-text" type="text" name="name" id="sy_qqappid" value="{yun:}$row.name{/yun}" size="30" maxlength="255"/><span class="admin_web_tip">如：定期修改职位</span></td>
        </tr>
        <tr>
            <th width="140">执行文件：</th>
            <td><input class="input-text" type="text" name="dir" id="sy_qqappid" value="{yun:}$row.dir{/yun}" size="30" maxlength="255"/><span class="admin_web_tip">执行文件名 如：index.php,文件存放路径/app/include/cron/</span></td>
        </tr>
        <tr>
          <th width="140">类型：</th>
          <td>
            <div class="layui-form-item">
              <div class="layui-input-block">
                <input name="type" lay-filter="radio_type" value="1" title="每周" 
                  {yun:}if $row.type=="1" || $row.type == ''{/yun} checked {yun:}/if{/yun}
                  type="radio"/>
                <input name="type" lay-filter="radio_type" value="2" title="每月" 
                  {yun:}if $row.type=="2"{/yun} checked {yun:}/if{/yun}
                  type="radio"/>
                <input name="type" lay-filter="radio_type" value="3" title="每天" 
                  {yun:}if $row.type=="3"{/yun} checked {yun:}/if{/yun}
                  type="radio"/>
                <input name="type" lay-filter="radio_type" value="4" title="每隔N秒" 
                  {yun:}if $row.type=="4"{/yun} checked {yun:}/if{/yun}
                  type="radio"/>
              </div>
            </div>
          </td>
        </tr>
      
        <tr id="weektrid" {yun:}if $row.type!='1' && $row{/yun} style="display:none"{yun:}/if{/yun}>
          <th width="140">每周：</th>
          <td>
            <div class="layui-form-item">
              <div class="layui-input-inline">
                <select name="week" id="weekid">
                	{yun:}foreach from=$arrweek key=k item=v{/yun}
                	<option value="{yun:}$k+1{/yun}" 
                    {yun:}if $row.week==$k{/yun} selected {yun:}/if{/yun}
                    >{yun:}$v{/yun}
                  </option>
                  {yun:}/foreach{/yun}
                </select>
              </div>
            </div>
          </td>
        </tr>
     
        <tr id="monthtrid" {yun:}if $row.type!='2'{/yun} style="display:none"{yun:}/if{/yun}>
          <th width="140">每月：</th>
          <td>
            <div class="layui-form-item">
              <div class="layui-input-inline">
                <select name="month" id="monthid">
                 	{yun:}foreach from=$montharr key=k item=v{/yun}
                 	<option value="{yun:}$k+1{/yun}" {yun:}if $row.month==$k{/yun}selected{yun:}/if{/yun}>{yun:}$v{/yun}</option>
                    {yun:}/foreach{/yun}
                </select>
              </div>
              <div class="layui-form-mid layui-word-aux">注：选对30日或31日当月无日期，则不执行</div>
            </div>
          </td>
        </tr>

        <tr id="hourtrid" {yun:}if $row.type == '4'{/yun} style="display:none"{yun:}/if{/yun}>
          <th width="140">小时：</th>
          <td>
            <div class="layui-form-item">
              <div class="layui-input-inline">
                <select name="hour">
                 	{yun:}foreach from=$hourarr key=k item=v{/yun}
                 	<option value="{yun:}$k{/yun}" {yun:}if $row.hour==$k{/yun}selected{yun:}/if{/yun}>{yun:}$v{/yun}</option>
                    {yun:}/foreach{/yun}
                </select>
              </div>
            </div>
          </td>
        </tr>

        <tr id="minutetrid" {yun:}if $row.type == '4'{/yun} style="display:none"{yun:}/if{/yun}>
            <th width="140">分钟：</th>
            <td><input class="input-text" type="text" name="minute" id="sy_qqappkey" value="{yun:}$row.minute{/yun}" size="40" maxlength="255"/><span class="admin_web_tip">不填请留空，默认:00</span></td>
        </tr>

        <tr id="secondtrid" {yun:}if $row.type != '4'{/yun} style="display:none"{yun:}/if{/yun}>
            <th width="140">每隔N秒执行一次：</th>
            <td>
              <input class="input-text" type="text" name="second" value="{yun:}$row.minute{/yun}" size="40" maxlength="255"
                onkeyup="this.value=this.value.replace(/[^0-9]/g,'');"
                />
              <span class="admin_web_tip">必填</span>
            </td>
        </tr>

       <tr>
          <th width="140">是否启用：</th>
          <td>
            <div class="layui-form-item">
              <div class="layui-input-inline">
                <input lay-skin="switch" name="display_switch" lay-filter="display_switch"
                 {yun:}if $row.display == "1"{/yun} checked{yun:}/if{/yun}
                 lay-text="是|否" type="checkbox" />
                <input type="hidden" name="display" value="{yun:}$row.display{/yun}" />
              </div>
            </div>
          </td>
        </tr>
        <tr>
          <th>&nbsp;</th>
			<td align="left" >
            <input name="id" value="{yun:}$row.id{/yun}" type="hidden">
            <input class="layui-btn layui-btn-normal" id="qqconfig" type="submit" name="msgconfig" value="提交" />&nbsp;&nbsp;
            <input class="layui-btn layui-btn-normal" type="reset" value="重置" /></td>
        </tr>
    </table>
    </form>
</div>

<script>
layui.use(['form','layer'], function(){
  var form = layui.form
    ,layer = layui.layer
    ,$ = layui.$;

  form.on('radio(radio_type)', function(data){
    var typeid = data.value;
    if(typeid==1){
      $("#weektrid").show();
      $("#monthtrid").hide();
      $("#secondtrid").hide();
    }else if(typeid==2){
      $("#monthtrid").show();
      $("#weektrid").hide();
      $("#secondtrid").hide();
    }else if(typeid == 3){
      $("#monthtrid").hide();
      $("#weektrid").hide();
      $("#secondtrid").hide();
    }
    else{
      $("#monthtrid").hide();
      $("#weektrid").hide();
      $("#hourtrid").hide();
      $("#minutetrid").hide();
      $("#secondtrid").show();
    }
  });

  form.on('switch(display_switch)', function(data){
    var v = this.checked ? 1 : 2;
    $("input[name=display]").val(v);
  });
});
</script></div>
</body>
</html>